<template>
  <div>
    <pulldown header="在所阶段">
      <div slot="content">
        <div slot="content">
          <a-table :columns="columns1" :data-source="forData1">

          </a-table>
        </div>
      </div>
    </pulldown>
    <pulldown header="出所记录">
      <div slot="content">
        <a-table :columns="columns2" :data-source="forData2">

        </a-table>
      </div>
    </pulldown>
    <pulldown header="报道记录">
      <div slot="content">
        <div slot="content">
          <a-table :columns="columns3" :data-source="forData3">

          </a-table>
        </div>
      </div>
    </pulldown>


    <!--    {{$filterDictTextByCache('process_approval_type', 1)}}-->
  </div>
</template>

<script>
import pulldown from '../../../modules/pulldown'
import {basicDetail, Families, holoArchivePlan, prisonInformation} from "@api/sjsk/archives";
export default {
  components:{ pulldown },

  mounted() {

  },
  data(){
    return   {
      columns1:[
        {
          title: '序号',
          dataIndex: 'age',
          key: 'age',
        },
        {
          title: '入所时间',
          dataIndex: 'admissionTime',
          key: 'admissionTime',
        },
        {
          title: '戒毒所名称',
          key: 'durgRehabilitatioName',
          dataIndex: 'durgRehabilitatioName',
          scopedSlots: { customRender: 'durgRehabilitatioName' },
        },
        {
          title: '入所原因',
          key: 'reasonsAdmission',
          dataIndex: 'reasonsAdmission',
          scopedSlots: { customRender: 'reasonsAdmission' },
        },
        {
          title: '决定机关',
          key: 'decisionOrgan',
          dataIndex: 'decisionOrgan',
          scopedSlots: { customRender: 'decisionOrgan' },
        },
        {
          title: '截止日期',
          key: 'enterEndTime',
          dataIndex: 'enterEndTime',
          scopedSlots: { customRender: 'enterEndTime' },
        },
      ],
      forData1:[],
      columns2:[
        {
          title: '序号',
          dataIndex: 'age',
          key: 'age',
        },
        {
          title: '出所时间',
          dataIndex: 'actualDepartureTime',
          key: 'actualDepartureTime',
        },
        {
          title: '出所原因',
          key: 'reasonGoOut',
          dataIndex: 'reasonGoOut',
          scopedSlots: { customRender: 'reasonGoOut' },
        },
        {
          title: '通知派出所单位',
          key: 'reasonGoOut',
          dataIndex: 'reasonGoOut',
          scopedSlots: { customRender: 'reasonGoOut' },
        },
        {
          title: '接收民警',
          key: 'receiveCivilianPolice',
          dataIndex: 'receiveCivilianPolice',
          scopedSlots: { customRender: 'receiveCivilianPolice' },
        },
        {
          title: '接收家属',
          key: 'receiveFamMember',
          dataIndex: 'receiveFamMember',
          scopedSlots: { customRender: 'receiveFamMember' },
        },
        {
          title: '负责人员',
          key: 'officePrincipal',
          dataIndex: 'officePrincipal',
          scopedSlots: { customRender: 'officePrincipal' },
        },
        {
          title: '附件',
          key: 'content',
          dataIndex: 'content',
          scopedSlots: { customRender: 'content' },
        },
      ],
      forData2:[],
      columns3:[
        {
          title: '序号',
          dataIndex: 'age',
          key: 'age',
        },
        {
          title: '报到时间',
          dataIndex: 'deadNewReport',
          key: 'deadNewReport',
        },
        {
          title: '报到执行地',
          key: 'receiveExecPlace',
          dataIndex: 'receiveExecPlace',
          scopedSlots: { customRender: 'receiveExecPlace' },
        },
        {
          title: '专干/社工人员',
          key: 'socialWorker',
          dataIndex: 'socialWorker',
          scopedSlots: { customRender: 'socialWorker' },
        },
        {
          title: '联系方式',
          key: 'socialWorkerPhone',
          dataIndex: 'socialWorkerPhone',
          scopedSlots: { customRender: 'socialWorkerPhone' },
        },
        {
          title: '附件',
          key: 'content',
          dataIndex: 'content',
          scopedSlots: { customRender: 'content' },
        },
      ],
      forData3:[]
    }
  },
  methods:{
    refreshTable(){
      let queryObj = {
        id: '1',
        type: '1'
      }
      this.refreshTable1(queryObj)
    },
    refreshTable1(queryObj){
      prisonInformation(queryObj).then(ser => {
        if(ser.success){
          let age = 0
          this.forData1 = ser.result.entryRecordVO
          this.forData2 = ser.result.exitRecordVO
          this.forData3 = ser.result.reportRecordVO
          for(let item of this.forData1){
            age++
            item.age = age
          }for(let item of this.forData2){
            age++
            item.age = age
          }for(let item of this.forData3){
            age++
            item.age = age
          }
          console.log(this.forData)
        } else {
          this.$message.error(ser.message)
        }
      }).catch(err => {

      })
    },
  }
}
</script>

<style scoped>

</style>